package top.rainf.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.vo.FriendRequest;
import top.rainf.mapper.FriendRequestMapper;
import top.rainf.service.IFriendRequestService;

import java.util.List;

/**
 * @author 星环
 * @date Wed May 10 21:04:41 CST 2023
 * @description FriendRequest服务的实现类
 */
@Service
public class FriendRequestService implements IFriendRequestService {

    @Autowired
    FriendRequestMapper friendRequestMapper;

    @Override
    public List<FriendRequest> getFriendRequestList() {
        return friendRequestMapper.selectAll();
    }



    @Override
    public FriendRequest getOneById(int id) {
        return friendRequestMapper.selectById(id);
    }

    @Override
    public boolean deleteOneById(int id) {
        return friendRequestMapper.deleteById(id) == 1;
    }

    @Override
    public boolean deleteAll(List<Integer> idList) {
        return friendRequestMapper.deleteByIds(idList) == idList.size();
    }

    @Override
    public boolean updateById(FriendRequest friendRequest) {
        return friendRequestMapper.updateById(friendRequest) == 1;
    }
}
